import { ipcRenderer } from 'electron'

const baseApi = {
  // 请求当前窗口状态
  getWindowState: () => ipcRenderer.send('get-window-state'),

  // 监听窗口状态变化（maximized / restored / minimized）
  onWindowStateChange: (callback: (state: any) => void) => {
    ipcRenderer.on('window-state', (_, state) => callback(state))
  },

  getTheme: () => ipcRenderer.invoke('base-get-theme'),
  setTheme: (theme: 'light' | 'dark') => ipcRenderer.invoke('base-set-theme', theme)
}

export default baseApi
